import request from '@/utils/request'

// 查询付款列表
export function listPayment(query) {
  return request({
    url: '/finance/payment/list',
    method: 'get',
    params: query
  })
}

// 查询付款详细
export function getPayment(id) {
  return request({
    url: '/finance/payment/' + id,
    method: 'get'
  })
}

// 新增付款
export function addPayment(data) {
  return request({
    url: '/finance/payment',
    method: 'post',
    data: data
  })
}


// 修改付款
export function updatePayment(data) {
  return request({
    url: '/finance/payment',
    method: 'put',
    data: data
  })
}


// 根据id查询一条计费记录
export function getPaymentById(id) {
  return request({
    url: '/finance/payment/byId?id=' + id,
    method: 'get'
  })
}

// 获取付款总额
export function selectSumAmount(accountsPayableId) {
  return request({
    url: '/finance/payment/accountsPayableId?accountsPayableId=' + accountsPayableId,
    method: 'get'
  })
}